//
//  UIImage+SMExtension.m
//  Practice
//
//  Created by yons on 13.8.20.
//  Copyright © 2020 yons. All rights reserved.
//


#import "UIImage+SMExtension.h"

@implementation UIImage (SMExtension)

/// 图片显示,自动判断
/// @param imageName 图片名
+ (UIImage *)sm_imageWithNamed:(NSString *)imageName {
    UIImage *image;
    NSString *imagePath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%.f", [[UIScreen mainScreen] scale]] ofType:@"png"];
    if (!imagePath) {
        image = [UIImage imageNamed:imageName];
    } else {
        image = [UIImage imageWithContentsOfFile:imagePath];
    }
    return image;
}


@end
